package pojo;

import java.util.Objects;

public class Bed {
    private int dormId;
    private int bedId;
    private boolean isUsed;

    public Bed() {
    }

    public Bed(int dormId, int bedId, boolean isUsed) {
        this.dormId = dormId;
        this.bedId = bedId;
        this.isUsed = isUsed;
    }

    public int getDormId() {
        return dormId;
    }

    public void setDormId(int dormId) {
        this.dormId = dormId;
    }

    public int getBedId() {
        return bedId;
    }

    public void setBedId(int bedId) {
        this.bedId = bedId;
    }

    public boolean isUsed() {
        return isUsed;
    }

    public void setUsed(boolean used) {
        isUsed = used;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Bed bed = (Bed) o;
        return isUsed == bed.isUsed &&
                Objects.equals(dormId, bed.dormId) &&
                Objects.equals(bedId, bed.bedId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dormId, bedId, isUsed);
    }

    @Override
    public String toString() {
        return "Bed{" +
                "dormId=" + dormId +
                ", bedId=" + bedId +
                ", isUsed=" + isUsed +
                '}';
    }
}
